﻿@model List<SuperiorModel.MenuModel>
@{
    ViewBag.Title = "分类管理";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<input type="hidden" id="mapRotute" map="map_menu" />
<div class="title_ding">

    <p id="location">
        当前位置：
        分类管理
    </p>
</div>
<div class="shopmain">
    <div class="shopbody">
        <div class="layui-card">
            @*<div class="layui-card-header">商城管理</div>*@
            <div class="layui-card-body">
                <blockquote class="layui-elem-quote layui-quote-nm">注：商城首页分类显示规则为,4个分类一行,为了界面美观,建议商户即使分类下没商品,也最好设置4个或者8个分类</blockquote>
                <div class="layui-form-item">
                    @*<label class="layui-form-label">版本</label>*@
                    <div class="layui-input-block" style="float:left; margin-left:0px;">
                        <button type="button" class="layui-btn" id="btn_addMenu">添加分类</button>
                    </div>
                </div>
                <div class="layui-form-item layui-form-text" id="dataList">
                    <table class="layui-table" lay-filter="test">
                        <thead>
                            <tr>
                                <th>分类名称</th>
                                <th>分类排序</th>
                                <th>分类图标</th>
                                <th>创建时间</th>
                                <th>状态</th>
                                <th>操作</th>
                            </tr>
                        </thead>
                        <tbody>
                            @foreach (var item in Model)
                            {
                                <tr>
                                    <td>@item.MenuName</td>
                                    <td>@item.Sorft</td>
                                    <td><img style="width:50px;height:50px;" src="@item.ImgPath" /></td>
                                    <td>@item.CreateTime</td>
                                    <td>
                                        @switch (item.OptionStatus)
                                        {
                                            case 1:
                                                <span style="color:green">上架中</span>
                                                break;
                                            case 0:
                                                <span style="color:orangered">下架中</span>
                                                break;
                                        }
                                    </td>
                                    <td>
                                        @switch (item.OptionStatus)
                                        {
                                            case 1:
                                                <a class="layui-btn layui-btn-normal layui-btn-xs layui-btn-mini OptionMenu" href="javascript:void(0);" Opt="0" OptionId="@item.Id">下架</a>
                                                break;
                                            case 0:
                                                <a class="layui-btn layui-btn-normal layui-btn-xs layui-btn-mini OptionMenu" href="javascript:void(0);" Opt="1" OptionId="@item.Id">上架</a>
                                                break;
                                        }
                                        <a class="layui-btn layui-btn-normal layui-btn-xs layui-btn-mini  DeleteMenu" href="javascript:void(0);" OptionId="@item.Id">删除</a>
                                        <a class="layui-btn layui-btn-normal layui-btn-xs layui-btn-mini menuEdit" href="javascript:void(0);" OptionId="@item.Id" MenuName="@item.MenuName" Sorft="@item.Sorft" ImgPath="@item.ImgPath" IsAll="@item.IsAll">编辑</a>
                                    </td>
                                </tr>
                            }
                        </tbody>
                    </table>
                </div>


            </div>
        </div>
    </div>
</div>

<script src="~/scripts/Product/Menu.js"></script>
<script>
    MenuClass.Instance.Init();
</script>
